package com.shenyi.common.shiro;

import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.web.filter.authc.FormAuthenticationFilter;
import org.apache.shiro.web.util.WebUtils;


import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

/**
 * @author richard.fan
 * @version 1.0
 * @date 2018/11/03
 * @desc 自定义表单认证过滤器
 * @see
 * @since 1.0
 */
public class MyFormAuthenticationFilter extends FormAuthenticationFilter {


    @Override
    protected boolean onLoginSuccess(AuthenticationToken token, Subject subject, ServletRequest request, ServletResponse response) throws Exception {
        String successUrl = "/index.html";
        WebUtils.issueRedirect(request, response, successUrl);
        return false;
    }
}
